package com.hzx.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.hzx.dao.DeptDao;
import com.hzx.entity.Dept;
@Repository
public class DeptDaoImpl extends BaseDaoImpl<Dept> implements DeptDao{

	@Override
    public Dept checkDept(String dname) {

        String hql = "from Dept where dname = ?";
        List<Dept> dept = (List<Dept>) this.getHibernateTemplate().find(hql, dname);
        if (dept != null && dept.size() > 0) {
            return dept.get(0);
        }

        return null;
    }

}
